package com.itstherules.jmsunit.examples;

import static com.itstherules.jmsunit.expectation.Expectations.anything;
import static com.itstherules.jmsunit.expectation.Expectations.headers;

import com.itstherules.jmsunit.JmsStandaloneMock;
import com.itstherules.jmsunit.managers.QueueManagersFactory;
import com.itstherules.jmsunit.managers.QueueManagersFactory.QueueManagerType;
import com.itstherules.jmsunit.mock.QueueRead;


public final class FinancialServiceMock {
	
	public static void main(String[] args) throws Exception {
		JmsStandaloneMock mock = new JmsStandaloneMock(QueueManagersFactory.create("vm://localhost", QueueManagerType.ActiveMQ));
		
		mock.when().through("red", QueueRead.ANYWHERE).with(anything()).reply("blue", "blueMessage", headers("Blue"));
		mock.when().through("blue", QueueRead.ANYWHERE).with(anything()).reply("green", "greenMessage", headers("Red"));
		
		mock.play();
	}
}
